<template>
	<view class="page-index">
		<view class="bar-area">
			<view class="fc-white fs30" @click="loginOut" :style="showQuitBtn?'':'visibility: hidden;'">退出</view>
			<view class="flex-row" @click="areaChange">
                <view class="fc-white fs35">执行</view>
            </view>
			<view class="fc-white fs30">{{ loginUser && loginUser.YHXM }}</view>
		</view>
        <view class="patient-info" v-if="step != 0">
            <view class="item-title">
                <view class="item-brch">{{ nowPatient.brch }}</view>
                <view class="item-info">
                    <view class="item-line"></view>
                    <view class="item-body">
                    <view class="item-body-top">
                        <view class="fs30 fb">{{ nowPatient.brxm }}</view>
                            <u--image
                                class="ml10"
                                width="20"
                                height="20"
                                :src="
                                nowPatient.brxbDm == 1 ? '/static/man.svg'
                                        : '/static/female.svg'
                                "
                            ></u--image>
                            <view class="fs30 fc-sub ml10">{{nowPatient.brnl}}</view>
                            <view class="fs30 fc-sub ml10">{{nowPatient.mzhm}}</view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="patientInfo-zd">
                诊断：{{nowPatient.brzs}}
            </view>
        </view>
		<view class="scan-tips-warning " v-if="step == 0"> 请扫描腕带 </view>
        <!-- <view class="scan-tips-warning " v-if="step == 1"> 请扫描输液贴 </view> -->
        <view class="scan-tips-primary" v-if="step == 1"> 已确认腕带信息 </view>
		<view class="scan-tips-warning " v-if="step == 2"> 请再确认患者腕带信息 </view>


		<!-- <view style="display:flex;position:absolute;top:0rpx;left:100rpx;">
			<view>
				<view @click="scanTest(testBrid,1)">腕带扫描测试</view>
				<view @click="scanTest(testIdMedordipex,2)">输液贴扫描测试</view>
			</view>
			<view>
				<input type="text" v-model="testBrid" placeholder="请输入病人id">
				<input type="text" v-model="testIdMedordipex" placeholder="请输入医嘱计划号">
			</view>
			<view>
				<view @click="showDoubleCheck = true">二次核对弹窗</view>
			</view>
		</view> -->
		



        <view class="main-context" v-if='step != 0'>
			<view class="filter-button" @click="handleExecuteFilter()">{{executeFilter == 3?'已执行':'未执行'}}</view>
            <u-tabs :list="tabList" :is-scroll="false" :current="currentTab" @change="tabChange"></u-tabs>
            <scroll-view
                class="scroll-view"
                scroll-y="auto"
                :refresher-enabled="false"
                @refresherrefresh="onPullRefresh"
                @scrolltolower="onReachBottomDistance"
                :refresher-triggered="isRefresherTriggered"
            >
                <view>
                    <view
                        :class="item.adviceStatus == '已执行'?'item-area executed':'item-area'"
                        v-for="(item, index) in listData"
                        :key="index"
                    >
                        <!-- <view class=""> -->
                            <!-- 医嘱区域 -->
                            <view class="item-content">
                                <view class="item-content-icon">{{item.adviceType}}</view>
                                <view class="item-content-list">
                                    <view class="list-item" v-for="(drug,drugIndex) in item.drugList" :key="drugIndex">
                                        <view class="item-name">{{drug.naSrvMed}} {{drug.spec}}</view>
                                        <view class="item-amount">{{drug.ycjl}}{{drug.jldw}}</view>
										<!-- <view class="item-freq">{{drug.pcbm}}</view> -->
                                    </view>
                                </view>
                                <view class="item-usage">
                                    {{item.usage}}
                                </view>
                            </view>
                            <view class="item-bottom">
                                <!-- 计划时间 -->
                                <view class="plan-datetime">
                                    计划时间：{{item.planTime}}
                                </view>
                                <view class="item-check-status">
                                    <view :class="item.adviceStatus == '已执行'?'item-check-yes':'item-check-no'">
                                        <u--image width="16" height="16"
                                        :src="item.adviceStatus == '已执行'?'/static/execute/success.svg':'/static/execute/warning.svg'"></u--image>
                                        {{item.adviceStatus}}
                                    </view>
                                </view>
                            </view>
                        <!-- </view> -->
                    </view>
                    
                    <!-- <button @click="showSuccessToast()">成功</button>
                    <button @click="showFailToast()">失败</button>
                    <button @click="showAlreadyToast()">已配药</button> -->
                    <u-empty
                        :show="!(listData && listData.length > 0)"
                        marginTop="300"
                    ></u-empty>
                </view>
            </scroll-view>
        </view>
        <!-- <button @click="handleDoubleCheck()">二次核对</button> -->
        <u-popup :show="showDoubleCheck" closeable @close="handleDoubleCheckClose()">
            <view class="double-check">
                <view class="double-check-title">二次核对</view>
                <view class="double-check-form-item">
                    <view class="double-check-form-item-label">护士用户名：</view>
                    <view class="double-check-form-item-input">
                        <u-input v-model="doubleCheckForm.userName" type="text"
                        placeholder="请输入用户名" clearable/>
                    </view>
                </view>
                <view class="double-check-form-item">
                    <view class="double-check-form-item-label">护士密码：</view>
                    <view class="double-check-form-item-input">
                        <u-input v-model="doubleCheckForm.password" type="password" 
                        placeholder="请输入密码" clearable/>
                    </view>
                </view>
                <view class="submit-button">
                    <button @click="handleDoubleCheckSubmit()">提交结果</button>
                </view>
            </view>
        </u-popup>
	</view>
</template>

<script>
import { mapState } from "vuex"
import { logout } from "@/api/utils.js"
import { 
	getDateTimeString,
	getAdviceType,
	getPlanStatus,
	showToast,
} from "@/static/js/common.js"

export default {
	components: {},
	props: {
		showQuitBtn: {
			type: Boolean,
			default:function () {
				return true
			}
		},
	},
	data() {
		return {
			step:0,// 0:初始化空白状态  1:已扫描腕带  2:已扫描输液贴

			isRefresherTriggered: false,

            tabList: [
				{
					name: '药品',
					type:1,
				}, 
				{
					name: '处置',//实际上是“治疗”类型
					type:24,
				}, 
				{
					name: '检查',
					type:21,
				}
			],
			currentTab: 0,

            showDoubleCheck:false,//二次核对弹框

            doubleCheckForm:{
                userName:null,//护士用户名
                password:null,//护士密码
				userId:null,//用户id
            },

			originListData:[],//医嘱接口返回的原始数据
			listData: [],// 医嘱计划处理后的数据
			nowPatient:{},// 当前病人
			nowIdVismed:'',//当前患者的就诊流程号
			nowIdMedord:'',//当前扫描出来的组号
			nowIdMedordipex:'',//当前扫描出来的医嘱计划号

			nowPlanList:[],//当前执行的计划列表
			nowPlanType:1,//医嘱类型 1：药品 24：处置 21：检查

			executeFilter:4,// 3：已执行 4：未执行  

			testBrid:'',//
			testIdMedordipex:'',//
		}
	},
	watch: {
		
	},
	computed: {
		...mapState(["loginUser", "area"]),
		actions() {
			if (this.area && this.area.length > 0) {
				let list = this.area.map((item) => {
					return {
						name: item.ksmc,
						code: item.ksdm,
					}
				})
				return list
			} else {
				return []
			}
		},
	},
	beforeDestroy(){
		uni.$off('scanCodeEmit');//取消监听
	},
	mounted() {
		// 接收原生扫描传值
		uni.$on("scanCodeEmit", async (res) => {
			console.log("执行扫描内容：", res)
			// uni.$emit("scanCodeEmit", res)

			if (res.indexOf("嘱") != -1) {//是医嘱
				if(this.step != 1){// 没有扫描腕带
					showToast(-1,'请先扫描患者腕带');
					return;
				}
				//先跳转到“药品”tab
				this.nowPlanType = 1;//搜索类型为药品
				this.currentTab = 0;//定位到“药品”tab
				this.executeFilter = 4;//切换为“未执行”
				await this.$nextTick()//等待异步渲染完成
				
				let idMedordipex = res.split(":")[1] // 获取到输液贴二维码上的医嘱组号

				let planListRes = await this.getPlanListByIdMedordipex(idMedordipex,1);
				let planList = planListRes.res.Data[0].hihisAdvicePlanBeanList;

				// 1：能执行 2:未核对 3：未配药  4:非药品类条码 5:管制类药品 
		 		// 6: 皮试类条码  -1：条码失效 7 未收费 8：非当前患者医嘱
				let checkExecuteRes = await this.checkExecute(planList);//判断是否可执行
				if(checkExecuteRes.res.ReType == 0){
					if(checkExecuteRes.res.Data == 1){//可以执行
						this.nowIdMedordipex = idMedordipex;
						this.handleScanExecute(planList);//执行
					}else if(checkExecuteRes.res.Data == 5){
						//管制药品，需要二次确认
						this.nowIdMedordipex = idMedordipex;
						this.nowPlanList = planList;
						this.doubleCheckForm = {
							userName:null,//护士用户名
							password:null,//护士密码
							userId:null,//用户id
						};
						this.showDoubleCheck = true;
					}else if(checkExecuteRes.res.Data == 9){ //医嘱已执行
						this.executeFilter = 3;//过滤已执行
						showToast(-1,checkExecuteRes.res.Msg);
						setTimeout(()=>{
							this.getPlanListByIdVismed(this.nowPatient.hisJzxh,1);
						},1000)
					}else{
						//不可执行
						showToast(-1,checkExecuteRes.res.Msg);
					}
				}else{
					// 请求失败
					showToast(-1,checkExecuteRes.res.Msg);
				}
			}else{//是腕带
				this.executeFilter = 4;//筛选未执行数据
				let patientRes = await this.getPatientByBrid(res);
				if(patientRes.res.Data.length == 0){
					showToast(-1,'没有找到病人信息');
					return;
				}
				this.nowPatient = patientRes.res.Data[0];//获取病人信息
				await this.getPlanListByIdVismed(this.nowPatient.hisJzxh,1);//获取医嘱计划列表  医嘱类型为 1：药品
				this.step = 1;//当前已扫描腕带
			}
		})

		console.log("当前登陆人信息：", this.loginUser);
	},
	methods: {
		/**
		 * 扫描测试
		 * type 1 腕带   2 输液贴
		 */
		async scanTest(res,type){
			if(type == 1){
				this.executeFilter = 4;//筛选未执行数据
				let patientRes = await this.getPatientByBrid(res);
				if(patientRes.res.Data.length == 0){
					showToast(-1,'没有找到病人信息');
					return;
				}
				this.nowPatient = patientRes.res.Data[0];//获取病人信息
				await this.getPlanListByIdVismed(this.nowPatient.hisJzxh,1);//获取医嘱计划列表  医嘱类型为 1：药品
				this.step = 1;//已扫描腕带
			}else if(type == 2){
				if(this.step != 1){// 没有扫描腕带
					showToast(-1,'请先扫描患者腕带');
					return;
				}
				//先跳转到“药品”tab
				this.nowPlanType = 1;//搜索类型为药品
				this.currentTab = 0;//定位到“药品”tab
				this.executeFilter = 4;//切换为“未执行”
				await this.$nextTick()//等待异步渲染完成

				let idMedordipex = res // 获取到输液贴二维码上的医嘱组号

				let planListRes = await this.getPlanListByIdMedordipex(idMedordipex,1);
				let planList = planListRes.res.Data[0].hihisAdvicePlanBeanList;

				// 1：能执行 2:未核对 3：未配药  4:非药品类条码 5:管制类药品 
		 		// 6: 皮试类条码  -1：条码失效 7 未收费 8：非当前患者医嘱
				let checkExecuteRes = await this.checkExecute(planList);//判断是否可执行
				if(checkExecuteRes.res.ReType == 0){
					if(checkExecuteRes.res.Data == 1){//可以执行
						this.nowIdMedordipex = idMedordipex;
						this.handleScanExecute(planList);//执行
					}else if(checkExecuteRes.res.Data == 5){
						//管制药品，需要二次确认
						this.nowIdMedordipex = idMedordipex;
						this.nowPlanList = planList;
						this.doubleCheckForm = {
							userName:null,//护士用户名
							password:null,//护士密码
							userId:null,//用户id
						};
						this.showDoubleCheck = true;
					}else if(checkExecuteRes.res.Data == 9){ //医嘱已执行
						this.executeFilter = 3;//过滤已执行
						showToast(-1,checkExecuteRes.res.Msg);
						setTimeout(()=>{
							this.getPlanListByIdVismed(this.nowPatient.hisJzxh,1);
						},1000)
					}else{
						//不可执行
						showToast(-1,checkExecuteRes.res.Msg);
					}
				}else{
					// 请求失败
					showToast(-1,checkExecuteRes.res.Msg);
				}
			}
		},


		/**
		 * 根据医嘱组号获取医嘱计划列表
		 * idMedord  医嘱组号
		 */
		getPlanListByIdMedordipex(id,yzlx){
			let params = {
				idMedord: null, //string 输液贴id - 对应pc端医嘱执行模块的医嘱组号
				adviceServiceType: 3, //number 1：核对模块 2 配药模块 3 执行 4：皮试执行
				jgid: this.loginUser.JZJGID, //短机构id
				ksid: this.loginUser.KSID, //科室id
				orgId: this.loginUser.JGID, //长机构id
				yhdm: this.loginUser.YHDM, //用户代码
				beginTime: null, //开始时间
				endTime: null, //结束时间
				idMedordipex: id, //执行计划id
				idVismed: this.nowPatient.hisJzxh, //就诊流程号|his就诊序号 ,
				isShowST: 0, //是否展示皮试医嘱控制 0 否 1 是 ,
				isOnlyST: 0, //是否只展示皮试医嘱
				jzfq: null, //急诊分区
				jzlc: 112, //就诊流程 默认值112 急诊 ,
				uid: this.loginUser.YHID, //当前登录人id ,
				yzlx: yzlx, //医嘱类型  1开头：药品| 21开头： 检查| 22开头： 检验 |23开头： 手术 |24 开头：治疗 |25开头： 护理 |26开头： 嘱托 |27开头： 诊疗 ,
				yzqx: null, //医嘱期效益 ,
				yzzt: null, //1:已核对 2 已配药 3 已执行 4 未执行(未核对|未配药|未执行)
			}

			return this.$commonAjax(
				"auth/mobile/advice/get/GetPlanList",
				params
			)
		},

		//过滤 已执行/未执行
		handleExecuteFilter(){
			this.executeFilter = this.executeFilter == 3?4:3;
			this.getPlanListByIdVismed(this.nowPatient.hisJzxh,this.nowPlanType);//刷新数据
		},
		//二次核对提交
        async handleDoubleCheckSubmit(){
			let params={
				yhdm: this.doubleCheckForm.userName,
				pwd: this.doubleCheckForm.password,// 输入 noPwd 时测试用 不走密码验证
				jgid: this.loginUser.JGID,
			}
			let result = await this.$commonAjaxGet("/mobile/user/checkUser", params);
			if (result.res.ReType == 0) {
				if(result.res.Data.YHID == this.loginUser.YHID){
					showToast(-1,'请更换护士进行二次核对');
					return;
				}
				this.doubleCheckForm.userId = result.res.Data.YHID;
				this.handleScanExecute(this.nowPlanList);
			} else {
				showToast(-1,'用户验证失败');
				return;
			}
        },
		//二次核对弹窗点击关闭
        handleDoubleCheckClose(){
            this.showDoubleCheck = false;
			this.doubleCheckForm = {
				userName:null,//护士用户名
				password:null,//护士密码
				userId:null,//用户id
			};
			this.nowPlanList = [];
        },


		/**
		 * 检查是否可执行
		 * planList
		 * 1：能 2:未核对 3：未配药  4:非药品类条码 5:管制类药品 
		 * 6: 皮试类条码  1：条码失效 7 未收费 8：非当前患者医嘱
		 */
		checkExecute(planList){
			console.log('医嘱计划原始数据：',this.originListData);
			console.log('执行入参：',planList);
			let list = [];
			let date = new Date();
			planList.forEach(el=>{
				list.push({
					// desClinicnoex: "string",
					dtClinicex: getDateTimeString(date),//执行时间
					// dtConfirmex: getDateTimeString(date),//确认执行时间 
					idClinicexper: this.loginUser.YHID,//临床执行人
					// idConfirmexper: "string",//临床确认执行人
					idDepClinicex: this.loginUser.JGID,//执行人部门id
					idEmpSign: this.doubleCheckForm.userId,//双签人用户id
					idMedord: el.idMedord,
					idMedordipex: el.idMedordipex,
					// note: null,//备注
					// sdClinicexpertpCd: "string",//临床执行人类型编码
					sdClinicextpCd: 2,//执行方式编码 1 PC 2 PDA 3 LIS 4 PACS 
					// sdClinicnoexCd: "string",//不执行原因编码
				})
			})
			let params={
				fgExecute: '1',
				idVismed: this.nowPatient.hisJzxh,
				executeOpPlanCOList: list,
			}
			return this.$commonAjax(
				"auth/mobile/advice/executeAdvice/CheckEcisExecuteAdvice",
				params
			)
		},
		/**
		 * 扫描执行医嘱
		 * planList 医嘱计划组
		 */
		async handleScanExecute(planList) {
			if(planList.length == 0){
				showToast(-1,'请先确认医嘱计划')
				return;
			};
			console.log('医嘱计划原始数据：',this.originListData);
			console.log('核对数据入参：',planList);
			let list = [];
			let date = new Date();
			planList.forEach(el=>{
				list.push({
					// desClinicnoex: "string",
					dtClinicex: getDateTimeString(date),//执行时间
					// dtConfirmex: getDateTimeString(date),//确认执行时间 
					idClinicexper: this.loginUser.YHID,//临床执行人
					nameClinicexper: this.loginUser.YHXM,//执行人姓名
					// idConfirmexper: "string",//临床确认执行人
					idDepClinicex: this.loginUser.KSID,//执行人部门id
					idEmpSign: this.doubleCheckForm.userId,//双签人用户id
					idMedord: el.idMedord,
					idMedordipex: el.idMedordipex,
					// note: null,//备注
					// sdClinicexpertpCd: "string",//临床执行人类型编码
					sdClinicextpCd: 2,//执行方式编码 1 PC 2 PDA 3 LIS 4 PACS 
					// sdClinicnoexCd: "string",//不执行原因编码
					idOrg:this.loginUser.JGID,//当前登陆人科室部门id
				})
			})
			let params={
				fgExecute: '1',
				idVismed: this.nowPatient.hisJzxh,
				executeOpPlanCOList: list,
				idClinicexper: this.loginUser.YHID,//临床执行人
				idOrg:this.loginUser.JGID,//当前登陆人科室部门id
				nameClinicexper: this.loginUser.YHXM,//执行人姓名
			}
			return this.$commonAjax(
				"auth/mobile/advice/executeAdvice/scanEcisAdviceExecute",
				params
			).then(res=>{
				showToast(res.res.ReType,res.res.Msg);//消息提示
				if(res.res.ReType == 0){
					// if(this.listData.find(el=>el.idMedordipex == this.nowIdMedordipex) != null){
					// 	this.listData.find(el=>el.idMedordipex == this.nowIdMedordipex).adviceStatus = '已执行';
					// }
					this.executeFilter = 3;//筛选已执行的数据
					setTimeout(()=>{
						this.getPlanListByIdVismed(this.nowPatient.hisJzxh,1);
					},1000);
					

					// this.step = 2;
					this.nowPlanList = [];
					this.showDoubleCheck = false;//关闭二次确认弹窗
				};
			})
		},
		/**
		 * 根据病人id 获取病人详情
		 * brid 病人id
		 */
		getPatientByBrid(brid){
			let params = {
				orgId: this.loginUser?.JGID,//长机构id
				jzlx: null,// 就诊类型 1 抢救 2 留观 3诊室 不传就是全部 
				lspb: 0,//离室判别
				yhdm: this.loginUser?.YHDM,// 当前登录用户的员工代码
				type: 1, //：病人列表   2：我的关注
				// hisJzxh: idVismed,
				// idMedord:idMedord,// 医嘱组号
				brid:brid,//病人id
				
			};
			return this.$commonAjax(
				"auth/mobile/patient/get/getPatientList",
				params
			)
		},

		/**
		 * 处理医嘱计划数据
		 */
		handlePlanList(listData){
			console.log('处理前的医嘱计划列表：',listData)
			let planList = [];
			listData.forEach(el=>{
				let obj = {
					idMedordipex:el.idMedordipex,
					adviceStatus:getPlanStatus(el.hihisAdvicePlanBeanList[0].adviceStatus),//状态
					planTime:el.hihisAdvicePlanBeanList[0].dtMedordsrvex,//计划时间
					usage:el.hihisAdvicePlanBeanList[0].yytjmc,//用法
					adviceType:getAdviceType(el.hihisAdvicePlanBeanList[0].sdSrvtpCd),
					drugList:el.hihisAdvicePlanBeanList,//药品医嘱列表
				}
				planList.push(obj);
			})
			console.log('处理后的医嘱计划列表：',planList)
			return planList;
		},
/**
		 * 根据 就诊流程号 获取病人所有医嘱
		 * idVismed 病人就诊流程号
		 * yzlx：医嘱类型  1 药品  21 检查
		 */
		getPlanListByIdVismed(idVismed,yzlx) {
			let params = {
				idMedord: null, //string 输液贴id - 对应pc端医嘱执行模块的医嘱组号
				adviceServiceType: 3, //number 1：核对模块 2 配药模块 3 执行 4：皮试执行
				jgid: this.loginUser.JZJGID, //短机构id
				ksid: this.loginUser.KSID, //科室id
				orgId: this.loginUser.JGID, //长机构id
				yhdm: this.loginUser.YHDM, //用户代码
				beginTime: null, //开始时间
				endTime: null, //结束时间
				idMedordipex: null, //执行计划id
				idVismed: idVismed, //就诊流程号|his就诊序号 ,
				isShowST: 0, //是否展示皮试医嘱控制 0 否 1 是 ,
				isOnlyST: 0, //是否只展示皮试医嘱
				jzfq: null, //急诊分区
				jzlc: 112, //就诊流程 默认值112 急诊 ,
				uid: this.loginUser.YHID, //当前登录人id ,
				yzlx: yzlx, //医嘱类型  1开头：药品| 21开头： 检查| 22开头： 检验 |23开头： 手术 |24 开头：治疗 |25开头： 护理 |26开头： 嘱托 |27开头： 诊疗 ,
				yzqx: null, //医嘱期效益 ,
				yzzt: this.executeFilter, //1:已核对 2 已配药 3 已执行 4 未执行(未核对|未配药|未执行)
			}

			return this.$commonAjax(
				"auth/mobile/advice/get/GetPlanList",
				params
			).then(res=>{
				console.log(11111111,res);
				this.originListData = res.res.Data;
				this.listData = this.handlePlanList(res.res.Data);//医嘱处理
				this.isRefresherTriggered = false;
			})
		},

        //tab 切换
        tabChange(tab){
			console.log('tab：',tab);
            this.currentTab = tab.index;
			this.nowPlanType = tab.type;
			this.getPlanListByIdVismed(this.nowPatient.hisJzxh,this.nowPlanType);//重新请求列表数据
        },
		loginOut() {
			logout()
		},
		onPullRefresh() {
			if (this.isRefresherTriggered) {
				return
			}
			this.isRefresherTriggered = true;
			this.getPlanListByIdVismed(this.nowPatient.hisJzxh,1);
		},
		onReachBottomDistance() {
			console.log(1111);
		},
	},
}
</script>

<style lang="scss">
.main-context{
	position: relative;
	height: calc(100% - 314rpx);

	.filter-button{
		font-size: 28rpx;
		color: #4088FE;
		background-color: #EBF3FE;
		border: 2rpx solid #4088FE;
		border-radius: 6rpx;
		width: 100rpx;
		text-align: center;
		padding: 10rpx 10rpx;
		position: absolute;
		right: 20rpx;
		top: 14rpx;
		z-index: 100;
	}
}
.scan-tips-warning {
	text-align: center;
	background-color: #faefe4;
	font-size: 30rpx;
	color: #ff9a27;
	padding: 10rpx 0rpx;
}
.scan-tips-primary {
	text-align: center;
	background-color: #4089fe1f;
	font-size: 30rpx;
	color: #4088FE ;
	padding: 10rpx 0rpx;
}
.bar-area {
	height: 100rpx;
	background-color: $bs-color-primary;
	display: flex;
	flex-direction: row;
	align-items: center;
	font-size: 30rpx;
	justify-content: space-between;
	padding: 0 30rpx;
}
.scroll-view {
	width: 100%;
	height: calc(100% - 112rpx);
	background-color: #f3f5f7;
	padding-bottom: 20rpx;
}
.patient-info{
    padding: 20rpx;
}
.item-area {
	margin: 20rpx 20rpx 0 20rpx;
	background-color: #ffff;
	border-radius: 10rpx;
	padding: 10rpx;
}
.executed{
	background-color: #a7ffa7;
}
.item-title {
	padding: 6rpx 10rpx 12rpx 10rpx;
	display: flex;
}
.item-line{
	width: 1rpx;
	background-color: #d6d7d9;
	height: 46rpx;
	width: 2rpx;
}

.item-body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 0 20rpx;
}
.item-body-top {
	display: flex;
	flex-direction: row;
	align-items: center;
	margin-bottom: 10rpx;
}
.item-check-status{
	width: 150rpx;
	font-size: 27rpx;
	margin-left: auto;
	font-weight: bold;
	
	.item-check-no{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 8rpx 15rpx;
		border-radius: 8rpx;
		background-color: #fff5ea;
        margin-right: 10rpx;
		white-space: nowrap;
	}
	.item-check-yes{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 8rpx 15rpx;
		border-radius: 8rpx;
		background-color: #26bf4017;
        margin-right: 10rpx;
		white-space: nowrap;
	}
}

.item-brch {
	width: 98rpx;
	font-size: 30rpx;
	color: #e06263;
	font-weight: bold;
}
.item-info{
    display: flex;
}

.item-content{
	font-size: 28rpx;
	padding: 10rpx 10rpx 4rpx 10rpx;
	display: flex;
    border-bottom: 1px solid #E9E9EB;
    position: relative;
	.item-content-icon{
		font-size:25rpx;
		padding: 4rpx 8rpx;
		border-radius: 8rpx;
		background-color: #fff5ea;
		color: #ff9a27;
		width: 28rpx;
		height: 37rpx;
		margin-right: 10rpx;
	}
	.item-content-list{
		padding: 6rpx 8rpx;
		.list-item{
			display: flex;
			margin-bottom: 6rpx;
			width: calc(100% - 80rpx);
			.item-name{
				color: #262626;
				margin-right: 20rpx;
				width: calc(100% - 120rpx);
			}
			.item-amount{
				color: #4088FE;
			}
			.item-freq {
				color: #262626;
				margin-left: 20rpx;
			}
		}
	}
    .item-usage{
        background-color: #F0F3F6;
        border-radius: 8rpx;
        padding: 4rpx 16rpx;
        height: 35rpx;
        font-size: 25rpx;
        position: absolute;
        top: 15rpx;
        right: 10rpx;
    }
	
}
.check-datetime{
	font-size: 25rpx;
	color: #909399;
	padding: 0rpx 12rpx 8rpx 12rpx;
}
.item-bottom{
    display: flex;
    align-items: center;
    margin-top: 10rpx;
    .plan-datetime{
        font-size: 25rpx;
        color: #909399;
        padding: 0rpx 12rpx 8rpx 12rpx;
    }
}

.patientInfo-zd{
    width: calc(100% - 100rpx);
    font-size: 25rpx;
	color: #909399;
	padding: 0rpx 12rpx 8rpx 12rpx;
    position: relative;
    left: 116rpx;
}
.double-check{
    height: 500rpx;
    position: relative;
    padding: 20rpx;
    .double-check-title{
        font-size: 34rpx;
        text-align: center;
        margin-bottom: 30rpx;
    }
    .double-check-form-item{
        display: flex;
        align-items: center;
        margin-bottom: 20rpx;
        .double-check-form-item-label{
            font-size: 32rpx;
            width: 200rpx;
        }
        .double-check-form-item-input{
            .u-input{
                background-color: #F9F9F9;
                width: 480rpx;
            }
        }
    }
    .submit-button{
        bottom: 10px;
        text-align: center;
        button{
            color: #FFFFFF;
            background-color: #4088FE;
            width: calc(100% - 20rpx);
            position: absolute;
            bottom: 0px;
            
        }
    }
}

</style>
